-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(ci): added continuous integration tests #4577
Conversation
When I was working on this PR, the latest version of Node.js at the time (22.5.0) had a regression that caused npm to fail, see nodejs/node#53902 and npm/cli#7672 so I pinned the node-version for Node 22 to 22.4.1 to prevent that regression from causing issues. As I was writing this PR, Node.js 22.5.1 came out and fixes that issue so this PR has gone back to using 22.x (see nodejs/node#53902 (comment)) EDIT: It seems like GitHub Actions has not started using 22.5.1 as the latest for 22.x so 22.4.1 will be used for now until Node gets updated for GitHub Actions EDIT 2: GitHub Actions node 22.x is now using 22.5.1 (see actions/node-versions#182) so this PR now uses 22.x. |
merge main
Fantastic! This is a great addition to the workflow. Thanks @Sebastian-Webster |
Thank you! No problem, I'm happy to contribute @junedchhipa :) |
Added CI tests
Before this PR there were CI tests, but they were only allowed to run on the
master
branch, and this repository does not have amaster
branch so they never ran. The changes in this PR are as follows:test:ci
script was made so tests that fail in CI will exit with an error status code, causing the CI job to fail. This was done because thenpm test
command does not exit with an error status code when a test fails, so if using the normal test command, a CI job will get marked as successful even if the tests fail.The testing & building workflow runs steps for 2 different repositories. One for the base repository (the apexcharts repository) and the head repository (repository where the PR code is coming from). The workflow first gets the code from the base repository and generates e2e test snapshots. After that, the head repository is checked out, and tests are ran against the snapshots generated from the base repository.
The reproducibility test is done to make sure any test changes are reproducible.
Base repository samples & snapshots and head repository samples, diffs, coverage, and build files are all uploaded to the workflow artifacts so if a job does fail, it can be easy to take a look at what happened and debug. For any changes that will intentionally fail tests (like an intentional UI change) the snapshots from the artifacts can be looked at to make sure everything looks as expected before merging a pull request.
Type of change
Checklist: